<?php

class postService
{
	protected $model;

	public function __construct(Post $post)
	{
		$this->model = $post;
	}

	public function update_creator_id($user_id, $post_id)
	{
		if (empty($post_id)) {
			return true;
		}
		$post = $this->model->find($post_id);
		if (empty($post) || $post->creator_id != 0) {
			return true;
		}
		$post->creator_id = $user_id;
		$post->save();
	}
}